<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<tiles:insertDefinition name="html.mainHeader.top"></tiles:insertDefinition>
<div class="head1_logo" style="height:90px">
	<div class="head_forumlogo">
		<a class="head1_logoa" href="#"></a>
		<div class="head_forum fr">
			<c:if test="${isLogin == false}">
				<p class="head_forumname">
				<input id="login_username" class="head_forumform" type="text" value="用户名" name="username">
				</p>
				<p class="head_forumpass">
				<input id="login_password" class="head_forumform" type="text" value="密码" name="password">
				</p>
				<p class="head_forump" style="height:21px">
				<span class="fl">
					<input id="login_cookie"  type="checkbox" name="cookie">
				</span>
				<span class="fr">自动登录</span>
				</p>
				<p class="head_forump1">
				<input class="but40fom" type="button" onclick="javascript:easylogin()" value="登录" name="">
				</p>
				<p class="head_forump2">
					<a class="l91c" target="_blank" href="#">忘记密码？</a>
					<a class="l91c" target="_blank" href="<c:url value="/h/gr.do"/>">立即注册？</a>
				</p>
			</c:if>
		</div>
	</div>
</div>
<div class="head_fnav">
	<a href="<c:url value='/home.do'></c:url>">首 页</a>
	<c:if test="${isLogin == true}">
		<a href="<c:url value='/space/index.do'></c:url>">Me</a>
	</c:if>
	<a class="head_fnava" href="<c:url value='/bbs/index.do'></c:url>">论坛</a>
	<a href="<c:url value='/klg/index.do'></c:url>">知识</a>
	<a href="<c:url value='/question/index.do'></c:url>">问答</a>
	<a href="<c:url value='/wiki/index.do'></c:url>">育儿字典</a>
	<a href="<c:url value='/team/list.do'></c:url>">母婴商城</a>
</div>
<c:set var="topLevels" value="${bbsHeaderBoardCS.topLevels}"></c:set>
<div class="head_fsunav">
	<c:forEach var="cs" items="${topLevels}" varStatus="topStatus">
		<c:set var="parent" value="${cs.current}"/>
		<c:set var="ulclass" value="head_fsunavul${topStatus.count}"></c:set>
		<ul class="${ulclass }">
			<li>
				<c:forEach var="childcs" items="${cs.children}" varStatus="childStatus">
					<c:set var="current" value="${childcs.current}"></c:set>
					<p>
					<a class="l666" href='<c:url value="/bbs/bi.do?bid=${current.boardId}" />'><c:out value="${current.chineseName}"/></a>
					</p>
				</c:forEach>
			</li>
		</ul>
	</c:forEach>
</div>

<script>
function easylogin(){
	var username = document.getElementById("login_username").value;
	var password = document.getElementById("login_password").value;
	$.ajax({
		type : "POST",
		url : ctx + "/h/login.do",
		data : "account=" + username + "&password="+password,
		dataType:"xml", 
		timeout:20000,
		success : function(data){
			if($(data).find('result').text().toUpperCase().indexOf("TRUE") >= 0){
				window.location.href = window.location.href;
			}else{
				var value = "";
				$(data).find('item').each(function(){
					position = $(this).find('position').text();
					value = $(this).find('value').text();
				});
				alert(value);
			}
		},
		error: function(){
		}
	});
}
</script>
